using SalesPages.DomainModel;
using System.ComponentModel.DataAnnotations;
using System.Data.Entity.ModelConfiguration;
namespace SalesPages.EntityFrameworkRepository.Mapping
{
    public class REDLuckyDrawMap : EntityTypeConfiguration<REDLuckyDraw>
    {
        public REDLuckyDrawMap()
        {
            // Primary Key
            this.HasKey(t => t.Id);

            // Properties
            this.Property(t => t.OpenId)
                .IsRequired()
                .HasMaxLength(50);

            this.Property(t => t.PhoneNo)
                .HasMaxLength(11);

            // Table & Column Mappings
            this.ToTable("REDLuckyDraw");
            this.Property(t => t.Id).HasColumnName("Id");
            this.Property(t => t.OpenId).HasColumnName("OpenId");
            this.Property(t => t.PrizeId).HasColumnName("PrizeId");
            this.Property(t => t.PhoneNo).HasColumnName("PhoneNo");
            this.Property(t => t.InsertDate).HasColumnName("InsertDate");
            this.Property(t => t.UpdateDate).HasColumnName("UpdateDate");
        }
    }
}
